package com.cmnit.analysis.application

import java.util.Date

import com.cmnit.analysis.common.TApplication
import com.cmnit.analysis.controller.{DayTollClearingController, NsattleMentSumController}
import com.cmnit.analysis.util.ServiceUtil
import org.apache.log4j.Logger


object AllApplication extends TApplication {

  val logger: Logger = Logger.getLogger(this.getClass)
  private val dayTollClearingController = new DayTollClearingController
  private val nsattleMentSumController = new NsattleMentSumController


  def run(acctTime: String): Unit = {
    start("All-Application") {

      if (acctTime.isEmpty) {
        dayTollClearingController.controller(ServiceUtil.getLastDayAcctDate(new Date))
        nsattleMentSumController.controller(ServiceUtil.getLastDayAcctDate(new Date))
      } else {
        dayTollClearingController.controller(acctTime)
        nsattleMentSumController.controller(acctTime)
      }

    }
  }
}
